Skip to content

fix(storefront): SD-11524 Add to Cart and quantity buttons disabled on Integration store when BCData is empty#2612

Merged
bc-yevhenii-buliuk merged 1 commit intobigcommerce:masterfrom
bc-yevhenii-buliuk:SD-11524
Feb 23, 2026
Merged

fix(storefront): SD-11524 Add to Cart and quantity buttons disabled on Integration store when BCData is empty#2612
bc-yevhenii-buliuk merged 1 commit intobigcommerce:masterfrom
bc-yevhenii-buliuk:SD-11524

Conversation

@bc-yevhenii-buliuk
Copy link
Contributor

@bc-yevhenii-buliuk bc-yevhenii-buliuk commented Feb 18, 2026

What?

This PR adds defensive validation before calling updateView() on product detail page initialization to prevent disabled Add to Cart and quantity +/- buttons when BCData.product_attributes is empty.

Problem
After merging PR #2601, Add to Cart and quantity +/- buttons are disabled on Integration store for simple product (without inventory tracking). The issue doesn't occur on Production/Staging.

PR #2601 removed the initial AJAX call and relies on BCData.product_attributes being populated on page load. On Integration store, this data is empty (BCData={}), causing updateView() to be called with empty data, which incorrectly triggers the disable logic in updateDefaultAttributesForOOS() method.

So we need to ensure that updateView() is only executed when actual product data is available.

Fixes the issue:
Buttons now work correctly on Integration store for simple products
No regression on Production/Staging environments
Variant selection continues to work properly (AJAX provides full data)

Known limitation:
When BCData.product_attributes is empty, out-of-stock UI features (disabled buttons, banners) may not display on initial page load. This is defensive behavior to prevent incorrect states from processing invalid data.

Requirements

  • CHANGELOG.md entry added (required for code changes only)

Tickets / Documentation

Screenshots (if appropriate)

  • locally on integration store
integration_without_BCData.mov
  • locally on staging store
staging_with_BCData.mov

@bc-alexsaiannyi
Copy link
Contributor

makes sense to me. @bc-yevhenii-buliuk, what do you think if we add console.warn with a message that BCData is empty to improve DX little bit more?

Copy link
Contributor

@bc-alexsaiannyi bc-alexsaiannyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@bc-yevhenii-buliuk bc-yevhenii-buliuk merged commit f3ce53f into bigcommerce:master Feb 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants